import React from 'react';
import { Select } from 'antd';

interface SerialParityViewProps {
  value?: string;
  onChange?: (value: string) => void;
}

const options = [
  { value: 'none', label: '无' },
  { value: 'even', label: '偶校验' },
  { value: 'odd', label: '奇校验' },
  { value: 'mark', label: '标记' },
  { value: 'space', label: '空格' },
];

const SerialParityView: React.FC<SerialParityViewProps> = ({
  value,
  onChange,
}) => (
  <Select
    placeholder="请选择校验方式"
    value={value}
    onChange={onChange}
    style={{ width: '100%' }}
    allowClear
    options={options}
  />
);

export default SerialParityView;
